<template>
  <div class="mb-4">
    <el-button>Default</el-button>
    <el-button v-on:click="changeUserName" type="success">Success</el-button>
  </div>
</template>
<!-- vue3写法 -->
<script lang="ts" setup>
function changeUserName() {
  //弹框
  const a = confirm('确认修改用户名吗？')
  if (a) {
    console.log('确认修改用户名')
  } else {
    console.log('取消修改用户名')
  }
}
</script>
<style></style>
